home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / gfx / 3d / 3dgpl.lha / engine.h < prev    next >
C/C++ Source or Header  |  1996-11-19  |  3KB  |  68 lines

  1. #ifndef _ENGINE_H_
  2. #define _ENGINE_H_
  3.  
  4. /** 3DGPL *************************************************\
  5.  *  ()                                                    *
  6.  *  Header for the 3D engine.                             *
  7.  *                                                        *
  8.  *  eng-base.c               polymorphic polygon.         *
  9.  *                                                        *
  10.  *  (6/1995) By Sergei Savhenko. (savs@cs.mcgill.ca).     *
  11.  *  Copyright (c) 1995 Sergei Savchenko.                  *
  12.  *  THIS SOURCE CODE CAN'T BE USED FOR COMERCIAL PURPOSES *
  13.  *  WITHOUT AUTHORISATION                                 *
  14. \**********************************************************/
  15.  
  16. /**********************************************************\
  17.  * Polygon:                                               *
  18.  *                                                        *
  19.  *  +--------------------+                                *
  20.  *  | m_id               | M_AMBIENT|M_SHADED|M_TEXTURED  *
  21.  *  |                    |                                *
  22.  *  | m_colour           |        +-------------+         *
  23.  *  | m_texture- - - - - - - - -> |texture bytes|         *
  24.  *  | m_log_texure_size  |        |             |         *
  25.  *  | m_log_texture_scale|        +-------------+         *
  26.  *  |                    |                                *
  27.  *  | m_u_index          |                                *
  28.  *  | m_v_index          |                                *
  29.  *  |                    |                                *
  30.  *  | m_no_edges         |                                *
  31.  *  | m_edges    +------------+                           *
  32.  *  |            |   vertex   |                           *
  33.  *  |            |   numbers  |                           *
  34.  *  |            |& attributes|                           *
  35.  *  |            |    ...     |                           *
  36.  *  |            +------------+                           *
  37.  *  +--------------------+                                *
  38. \**********************************************************/
  39.  
  40. #define M_AMBIENT              0x3          /* constant colour polygon */
  41. #define M_SHADED               0x4          /* Gouraud shaded polygon */
  42. #define M_TEXTURED             0x5          /* texture mapped polygon */
  43. #define M_POLYGON_LENGTH_LIMIT  50          /* length of tmp arrays */
  44.  
  45. #define M_SIZE_EDGE_ARRAY       15          /* coordinates + colours + etc */
  46.  
  47. struct M_polygon                            /* describes one polygon */
  48. {
  49.  int m_id;                                  /* M_AMBIENT|M_SHADED|M_TEXTURED */
  50.  
  51.  int m_colour;                              /* only for M_AMBIENT */
  52.  unsigned char *m_texture;                  /* only for M_TEXTURED */
  53.  int m_log_texture_size;                    /* log base 2 of texture size */
  54.  int m_log_texture_scale;                   /* log base 2 texture scaling */
  55.  
  56.  int m_u_index;                             /* indexes of texture */
  57.  int m_v_index;                             /* orientation vectors */
  58.  
  59.  int m_no_edges;                            /* number of edges in the polygn */
  60.  int m_edges[M_SIZE_EDGE_ARRAY];            /* numbers/attributes */
  61. };
  62.  
  63. void M_render_polygon(struct M_polygon *polygon,int *vertexes,int *vectors);
  64.  
  65. /**********************************************************/
  66.  
  67. #endif
  68.